#include<iostream>

#include"List.hpp"

using namespace std;

namespace MyList{

  void list_test1(){
  //  cout<<"test1"<<endl;
  
    list<int> l1;
    l1.push_back(1);
    l1.push_back(2);
    l1.push_back(3);
    l1.push_back(4);
    l1.push_back(5);

    l1.push_front(666);

    l1.pop_back();
    l1.pop_back();

    l1.pop_front();

    list<int>::iterator it = l1.begin();

    while(it!=l1.end()){
      cout<<*it<<" ";
      it++;
    }
    cout<<endl;
  }


  void list_test2(){
  
    list<int> l1;
    l1.push_back(1);
    l1.push_back(2);
    l1.push_back(3);
    l1.push_back(4);
    l1.push_back(5);

    l1.push_front(666);


    list<int>::reverse_iterator it = l1.rbegin();
    list<int>::reverse_iterator en = l1.rend();

    while(it!=l1.rend()){
      cout<<*it<<" ";
      it++;
    }
    cout<<endl;
  }

  ////////////////////////////
}

int main()
{

//  MyList::list_test1();
  MyList::list_test2();
  return 0;
}
